<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var a = 10;
        var b = 20;
        var funcA = function(resolve) {
            setTimeout(function() {
                var ans = a + b;
                console.log("答案为:" +
                    ans);
                resolve("ans");
            }, 500)
        }

        var funcB = function() {
            return new Promise(function(resolve) {
                setTimeout(function() {

                    var ans = (a + b) * 3
                    console.log("答案为:" +
                        ans);
                    resolve("随便一些数据");
                }, 500)
            })
        }

        var funcC = function() {
            return new Promise(function(resolve) {
                setTimeout(function() {
                    var ans = (a + b) * 3 - 6
                    console.log("答案为:" +
                        ans);
                    resolve("随便一些数据");
                }, 500)
            })
        }



        new Promise(funcA).then(funcB).then(funcC);
    </script>


</body>

</html>